<template>
	<div class="container">
		<navigationBar title="赞与收藏"></navigationBar>
		<div class="content" :style="'padding-top: ' + (navigationBarHeight-1) + 'px;'">
			<div class="list">
				<div class="item" v-for="(item,index) in list" :key="index">
					<a class="user-avatar" @click="$navSkin.toPersonel(item.userId)">
						<image class="avatar-item user-avatar" :src="item.avatar" mode="aspectFill"></image>
					</a>
					<div class="main">
						<div class="info">
							<div class="user-info" @click="$navSkin.toPersonel(item.userId)">{{item.nickname}}</div>
							<div class="interaction-hint" @click="$navSkin.toProduct(item.informationId)">
								<span>{{item.type == 1?'收藏了你的笔记':item.type == 2?'赞了你的笔记':'赞了你的评论' }}</span>
								<span
									class="interaction-time">{{item.createTime? $utils.timestampFormat(Date.parse(item.createTime)/1000) : ''}}</span>
							</div>
							<div class="quote-info" @click="$navSkin.toProduct(item.informationId)"
								v-if="item.type == 3">{{item.content || '评论已经被删除'}}</div>
						</div>
						<div class="extra" @click="$navSkin.toProduct(item.informationId)">
							<image
								v-if="item.firstFileSuffix !== 'png' && item.firstFileSuffix !== 'jpg' && item.firstFileSuffix !== 'jpge' "
								:style="item.firstCoverPath?'':'height:0'" :src="item.firstCoverPath"
								class="extra-image" mode="aspectFill" />
							<image v-else :src="item.firstPicturePath" class="extra-image" mode="widthFix" />

						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
</template>

<script>
	import data from '@/js/index/notificationLike/data.js';
	import methods from '@/js/index/notificationLike/methods.js';
	import {
		mapState
	} from 'vuex';
	import navigationBar from '../../components/navigationBar.vue';


	export default {
		data,
		methods,
		onLoad(e) {
			this.getPageList()
		},
		onShow() {

		},
		onReachBottom() {
			this.getPageList()
		},
		onHide() {

		},
		onUnload() {

		},
		components: {
			navigationBar,
		},
		computed: {
			...mapState(['navigationBarHeight', 'userInfo'])
		},
		filters: {
			// fmtContent(value) {
			// 	value = JSON.parse(value)
			// 	if (value.message_type === 'image') {
			// 		return '[图片消息]'
			// 	} else {
			// 		return value.content
			// 	}
			// }
		}
	};
</script>
<style>
	page {
		background: #FFF;
	}

	uni-page {
		background: #FFF;
	}
</style>
<style scoped lang="scss">
	@import '~@/style/index/notificationLike.scss';
</style>